package cn.imjzm.runcarserve.service.impl;

import cn.imjzm.runcarserve.pojo.SmokeData;
import cn.imjzm.runcarserve.service.SmokeService;
import org.springframework.stereotype.Service;

@Service
public class SmokeServiceImpl implements SmokeService {

    // 最新上传的烟雾数据（保存在内存中）
    private SmokeData latest;

    @Override
    public SmokeData getRealTimeSmokeData() {
        return latest;
    }

    @Override
    public void updateRealTimeSmokeData(SmokeData data) {
        this.latest = data;
        System.out.println("✅ 收到并缓存来自 Python 的烟雾数据：" + data);
    }
}
